﻿@model Back_end.Models.Complaint

@{
    ViewBag.Title = "详细";
    var pp = Model.PicturePath == null ? "" : Model.PicturePath;
    var tp = Model.Tag == null ? "" : Model.Tag;
    var pps = pp.Split('|');
    var tps = tp.Split('|');
}

<h2>Details</h2>

<div>
	<p>共 @ViewBag.Followed 人关注，@ViewBag.Liked 人赞同</p>
    <hr />
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.UserName)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.UserName)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.PublishedDate)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.PublishedDate)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Text)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Text)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.PicturePath)
        </dt>

        <dd>
            @foreach (string path in pps)
			{ <img src=@path class="img-thumbnail col-md-4"><br /> }
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Location)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Location)
        </dd>

		<dt>
			@Html.DisplayNameFor(model => model.Company)
		</dt>

		<dd>
			@Html.DisplayFor(model => model.Company)
		</dd>

        <dt>
            @Html.DisplayNameFor(model => model.Tag)
        </dt>

        <dd>
            @foreach (var tag in tps)
            { <span class="label label-info" style="margin-right:10px">@tag </span> }
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.AllowedPublished)
        </dt>

        <dd>
            @{  string allow = this.Model.AllowedPublished == null ? "审核中"
                    : (bool)this.Model.AllowedPublished ? "已通过" : "未通过";
            }
            @allow
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.HadProcessed)
        </dt>

        <dd>
            @{  string processed = this.Model.HadProcessed == null ? "未处理"
                    : (bool)this.Model.AllowedPublished ? "已处理" : "处理中";
            }
            @processed
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Review)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Review)
        </dd>

    </dl>
</div>
<p>
    @Html.ActionLink("编辑", "Edit", new { id = Model.ComplaintId }) |
    @Html.ActionLink("返回列表", "Index")
</p>
